home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Reference / FAQs on CD / comp.lang.obj-C FAQ (1⁄3) ans < prev    next >
Encoding:
Text File  |  1997-04-24  |  39.9 KB  |  951 lines  |  [TEXT/R*ch]

  1. Newsgroups: comp.lang.objective-c,comp.answers,news.answers
  2. From: tiggr@es.ele.tue.nl (Tiggr)
  3. Subject: comp.lang.objective-c FAQ, part 1/3: Answers
  4. Summary: This first part of the comp.lang.objective-c FAQ postings
  5.     tries to answer all your Objective-C questions.
  6. Reply-To: tiggr@es.ele.tue.nl (Tiggr)
  7. Followup-To: comp.lang.objective-c
  8. Organization: Eindhoven University of Technology, the Netherlands
  9. Approved: news-answers-request@mit.edu
  10. Keywords:
  11.  
  12. Archive-name: Objective-C/answers
  13. Version: $Id: answers,v 3.36 1997/01/31 14:16:17 tiggr Exp $
  14.  
  15.  
  16.                  Answers to
  17.  
  18.              FREQUENTLY ASKED QUESTIONS
  19.  
  20.                concerning Objective-C
  21.  
  22.  
  23. This is the first in a series of three informational postings concerning
  24. comp.lang.objective-c.  This first part answers FAQs; the second part lists
  25. available class libraries and the third part is a simple sample Objective-C
  26. program.
  27.  
  28. This posting answers the following questions:
  29.  
  30.  1   What is Objective-C?
  31.  2   What is the difference between Objective-C and C++?
  32.  3   What exactly is it that makes Objective-C have `classes similar to
  33.      Smalltalk', and what are the resulting capabilities of Objective-C?
  34.  4   What are the `nice features' of Objective-C?
  35.  5   What are some of the common problems of the language and how can I work
  36.      around them?
  37.  6   What object encapsulation does Objective-C provide?
  38.  7   What are Protocols?
  39.  8   How can garbage collection be applied to Objective-C?
  40.  9   What is the difference between the NeXTSTEP, Stepstone and GNU CC
  41.      versions of Objective-C?
  42.  10  How do I debug Objective-C using a non-NeXT gdb?
  43.  11  I get this `Floating exception'...
  44.  12  Why am I lectured by gcc about `#import'?
  45.  13  Did NeXT buy Stepstone?  [NO!]
  46.  14  What written information concerning Objective-C is available?
  47.  15  What kind of Objective-C support is provided by Stepstone?
  48.  16  What kind of Objective-C support is provided by NeXT?
  49.  17  What kind of Objective-C support is provided by GNU?
  50.  18  Is Objective-C supported on <my favourite platform>?
  51.  19  What are the newsgroups to read or mailing lists to subscribe to in order
  52.      to stay up-to-date on developments for GNU Objective-C?
  53.  20  Are there any FTP sites with Objective C code?  Where?
  54.  21  If there any information on the Net concerning Objective-C?
  55.  22  For more information...
  56.  
  57. (To find a question search on the question number starting a line.)
  58.  
  59. 1   What is Objective-C?
  60.  
  61.     Objective-C is an object oriented computer programming language.  It is
  62.     a superset of ANSI C and provides classes and message passing similar to
  63.     Smalltalk.
  64.  
  65.     Objective-C includes, when compared to C, a few more keywords and
  66.     constructs, a short description of which follows.  For a complete example
  67.     of the application of the constructs, see part 3 of this FAQ.
  68.  
  69.     `@interface' declares a new class.  It indicates the name of the class,
  70.     the name of its superclass, the protocols adhered to (see Q7), the
  71.     layout of the instance variables (similar to the definition of a struct,
  72.     but including encapsulation information (see Q6)) and declares the
  73.     methods implemented by this class.  A class' interface usually resides
  74.     in a file called `<classname>.h'.
  75.  
  76.     `@implementation' defines a class.  The implementation is no more than a
  77.     collection of method definitions.  Without an implementation, a class
  78.     does not exist at run time.  The implementation of a class usually
  79.     resides in a file called `<classname>.m'.
  80.  
  81.     A `@category' is a named collection of method definitions which are
  82.     added to an existing class.  With the NeXT runtime, a category can
  83.     redefine existing methods.  However, with the GNU runtime, a category
  84.     can not do so.
  85.  
  86.     Objective-C includes the predefined type `id' which stands for a pointer
  87.     to some object.  Thus, `id obj;' declares a pointer to an object.  The
  88.     actual class of the object being pointed to is almost irrelevant, since
  89.     Objective-C does run-time type checking.
  90.  
  91.     `-message;' declares a method called `message'.  The `-' indicates that
  92.     the message can be sent to objects.  A `+' instead indicates the message
  93.     can be sent to class objects.  A method is similar to a function in that
  94.     it has arguments and a return value.  The default return type is `id'.
  95.     If a method has nothing useful to return, it returns `self', which is a
  96.     pointer to the object to which the message was sent (similar to `this'
  97.     in C++).
  98.  
  99.     [obj message], [obj message: arg1] and [obj message: arg1 with: arg2]
  100.     are examples of sending a message to the object OBJ with 0, 1 and 2
  101.     arguments respectively.  The name of the message is called the selector.
  102.     In this example, the selectors are: `message', `message:' and
  103.     `message:with:', respectively.
  104.  
  105. 2   What is the difference between Objective-C and C++?
  106.  
  107.     C++ follows the Simula 67 school of OO programming, where Objective-C
  108.     follows the Smalltalk school.  In C++ an object's static type as
  109.     perceived by the sender of a message determines which method will
  110.     actually be invoked; this is static binding.  In Smalltalk the actual
  111.     type of the object at run time determines the method, i.e. binding is
  112.     dynamic.  As a result, in Smalltalk objects are not even statically
  113.     typed; (in Objective-C static typing is optional).  The Simula 67
  114.     school is safer, since static typing is mandatory and more errors are
  115.     detected at compile time.  The Smalltalk school is more flexible, as
  116.     some valid programs will execute correctly in Smalltalk, where they
  117.     would be rejected by Simula 67.
  118.  
  119.     Stepstone's Objective-C allows you to chose between the dynamic and
  120.     static binding, GNU and NeXT do not.  ANSI C++ allows you to use dynamic
  121.     binding, but discourages you from doing so.
  122.  
  123.     In many ways, the difference between C++ and Objective-C is more a
  124.     question of mindset than technical barriers.  Are you willing to offer
  125.     some flexibility for some safety?  Advocates for the Simula 67 school
  126.     claims that a well designed program doesn't need the extra flexibility
  127.     (a lie), while advocates for the Smalltalk school claims that the
  128.     errors are no problem in practice (another lie).  The truth lies
  129.     somewhere in the middle, with contemporary Objective-C programming
  130.     practices employing dynamic binding (mandatory) and static typing.
  131.  
  132.     Pragmatic differences between Objective-C and C++ include:
  133.  
  134.     C++ has operator overloading.  Some consider this to be `syntactic
  135.     sugar', and it is, but it can be a quite handy bit of sugar.
  136.  
  137.     C++ has multiple inheritance.  There are several ways to `get
  138.     around' this in Objective-C (see below).
  139.  
  140.     The added syntax and semantics of C++ is huge, while Objective-C is
  141.     C plus just a small number of new features.
  142.  
  143. 3   What exactly is it that makes Objective-C have `classes similar to
  144.     Smalltalk', and what are the resulting capabilities of Objective-C?
  145.  
  146.     Objective-C is as close to Smalltalk as a compiled language allows.  The
  147.     following is a list of the features `taken' from Smalltalk:
  148.  
  149.       * Objective-C is compiled---Smalltalk is only partially compiled.  The
  150.     current Objective-C implementations are all *much* faster than any
  151.     Smalltalk.  For example ParcPlace Smalltalk-80/4 is at least 3 times
  152.     slower than both the GNU and NeXT Objective-C's.  (This was measured
  153.     using the Self/Smalltalk benchmark suite available by FTP from
  154.     `self.stanford.edu:pub/Self-2.0.1'.)
  155.  
  156.     The big difference of course is that Objective-C does hybrid typing:
  157.     one can choose to represent a string as a `char *' or as an object,
  158.     whereas in Smalltalk, everything is an object.  This is a reason for
  159.     Objective-C being faster.  On the other hand, if every bit of
  160.     information in an Objective-C program would be represented by an
  161.     object, the program would probably run at a speed comparable to
  162.     Smalltalk and it would suffer from not having optimizations
  163.     performed on the basic classes, like Smalltalk can do.
  164.  
  165.       * You may add or delete methods and classes at runtime.  (On GNU and
  166.     NeXT one can load new classes and categories.  On Stepstone, which
  167.     lacks categories, the only way to add methods is to load a subclass
  168.     which then does a `+poseAs:' of the class to have methods added.
  169.     This is less flexible, but it sort-of does the trick of just adding
  170.     methods.)
  171.  
  172.       * Much of the syntax, i.e. Smalltalk uses method names like
  173.     `a:method:name:', as does Objective-C.  In Objective-C, the message
  174.     sending construct is enclosed in square brackets, like this:
  175.     `[anObject aMessage: arg]' whereas Smalltalk uses something like
  176.     `anObject aMessage: arg'.
  177.  
  178.       * The basic class hierarchy, that is, having class `Object' in the very
  179.     top, and letting most other classes inherit from it.
  180.  
  181.       * Most method names in class object is the same.  E.g. `respondsTo:'.
  182.     What is called `doesNotUnderstand:' in Smalltalk is called
  183.     `doesNotRecognize:' in Objective-C.
  184.  
  185.       * Smalltalk normally uses `doesNotUnderstand:' to implement
  186.     forwarding, delegation, proxies, etc.  In Objective-C, such
  187.     functionality is implemented by `forward::'.
  188.  
  189.       * Objective-C has meta classes mostly like Smalltalk.
  190.  
  191.       * Objective-C does not have class variables like Smalltalk, but pool
  192.     variables and globals are easily emulated via static variables.
  193.  
  194. 4   What are the `nice features' of Objective-C?
  195.  
  196.     The possibility to load class definitions and method definitions
  197.     (which extend a class) at run time.
  198.  
  199.     Objects are dynamically typed: Full type information (name and type
  200.     information of methods and instance variables and type information
  201.     of method arguments) is available at run time.  A prime example of
  202.     application of this feature is `-loadNibSection:owner:' method of
  203.     NeXTSTEP's Application class.
  204.  
  205.     Persistence [...].
  206.  
  207.     Remote objects [...].
  208.  
  209.     Delegation and target/action protocols [...].
  210.  
  211. 5   What are some of the common problems of the language and how can I work
  212.     around them?
  213.  
  214.     There are some `common problems':
  215.  
  216.     There is no innate multiple inheritance (of course some see this as
  217.     a benefit).
  218.  
  219.         To get around it you can create a compound class, i.e. a class
  220.         with instance variables that are ids of other objects.
  221.         Instances can specifically redirect messages to any combination
  222.         of the objects they are compounded of.  (It isn't *that* much of
  223.         a hassle and you have direct control over the inheritance
  224.         logistics.)  [Of course, this is not `getting around the problem
  225.         of not having multiple inheritance', but just modeling your
  226.         world slightly different in such a way that you don't need
  227.         multiple inheritance.]
  228.  
  229.         Protocols address the absence of multiple inheritance (MI) to
  230.         some extent: Technically, protocols are equivalent to MI for
  231.         purely "abstract" classes (see the answer on `Protocols' below).
  232.  
  233.         [How does Delegation fit in here?  Delegation is extending a
  234.         class' functionality in a way anticipated by the designer of
  235.         that class, without the need for subclassing.  One can, of
  236.         course, be the delegate of several objects of different
  237.         classes.  ]
  238.  
  239.     There are no class variables.
  240.  
  241.         You can get around this by defining a static variable in the
  242.         implementation file, and defining access methods for it.  This
  243.         is actually a more desirable way of designing a class hierarchy,
  244.         because subclasses shouldn't access superclass storage (this
  245.         would cause the subclass to break if the superclass was
  246.         reimplemented), and allows the subclass to override the storage
  247.         (if the classes access all their own variables via methods).
  248.  
  249.         [The question remains what the exact syntax of class variables
  250.         should be: Should a class object A be seen as an instance of its
  251.         meta-class MA, which has a super class MB being the meta-class
  252.         of A's super, B, and, as such, should A have separate instances
  253.         of class variables defined for B?  Or not?]
  254.  
  255. 6   What object encapsulation does Objective-C provide?
  256.  
  257.     Object encapsulation can be discerned at two levels: encapsulation of
  258.     instance variables and of methods.  In Objective-C, the two are quite
  259.     different.
  260.  
  261.     Instance variables:
  262.  
  263.     The keywords @public, @private and @protected are provided to secure
  264.     instance variables from prying eyes to some extent.
  265.  
  266.         @public        anyone can access any instance variable.
  267.         @protected    only methods belonging to this object's
  268.                 class or a subclass thereof have access to
  269.                 the instance variables.
  270.         @private    only methods of this class may access the
  271.                 instance variables.  This excludes methods
  272.                 of a subclass.
  273.  
  274.     If not explicitly set, all instance variables are @protected.
  275.     Note: Instance variable encapsulation is enforced at compile-time.
  276.     At run-time, full typing information on all instance variables is
  277.     available, which sort-of makes all variables @public again.  This
  278.     information is for instance used to do instance variable lookup by
  279.     NeXTSTEP's `loadNibSection:owner:' method, making it completely
  280.     safe.
  281.  
  282.     Methods:
  283.  
  284.     To the Objective-C runtime, all methods are @public.  The programmer
  285.     can only show his/her intention of making specific methods not
  286.     public by not advertising them in the class' interface.  In
  287.     addition, so-called private methods can be put in a category with a
  288.     special name, like `secret' or `private'.
  289.  
  290.     However, these tricks do not help much if the method is declared
  291.     elsewhere, unless one reverts to indicating the object's type at
  292.     compile time.  And the runtime doesn't care about all this and any
  293.     programmer can easily circumvent the tricks described.  Thus, all
  294.     methods really are always @public.
  295.  
  296. 7   What are Protocols?
  297.  
  298.     Protocols are an addition to Objective-C that allows you to organize
  299.     related methods into groups that form high-level behaviors.  Protocols
  300.     are currently available in NeXTSTEP (since 3.0) and GCC (since 2.4).
  301.  
  302.     Protocols address the MI issue.  When you design an object with multiple
  303.     inheritance, you usually don't want *all* the features of both A and B,
  304.     you want feature set X from A and feature set Y from B.  If those
  305.     features are methods, then encapsulating X and Y in protocols allows you
  306.     to say exactly what you want in your new object.  Furthermore, if
  307.     someone changes objects A or B, that doesn't break your protocols or
  308.     your new object.  This does not address the question of new instance
  309.     variables from A or B, only methods.
  310.  
  311.     Protocols allow you to get type-checking features without sacrificing
  312.     dynamic binding.  You can say "any object which implements the messages
  313.     in Protocol Foo is OK for this use", which is usually what you want -
  314.     you're constraining the functionality, not the implementation or the
  315.     inheritance.
  316.  
  317.     Protocols give library builders a tool to identify sets of standard
  318.     protocols, independent of the class hierarchy.  Protocols provide
  319.     language support for the reuse of design, whereas classes support the
  320.     reuse of code.  Well designed protocols can help users of an application
  321.     framework when learning or designing new classes.  Here is a simple
  322.     protocol definition for archiving objects:
  323.  
  324.     @protocol Archiving
  325.     -read: (Stream *) stream;
  326.     -write: (Stream *) stream;
  327.     @end
  328.  
  329.     Once defined, protocols can be referenced in a class interface as
  330.     follows:
  331.  
  332.     /* MyClass inherits from Object and conforms to the
  333.        Archiving protocol.  */
  334.     @interface MyClass: Object <Archiving>
  335.     @end
  336.  
  337.     Unlike copying methods to/from other class interfaces, any incompatible
  338.     change made to the protocol will immediately be recognized by the
  339.     compiler (the next time the class is compiled).  Protocols also provide
  340.     better type checking without compromising the flexibility of untyped,
  341.     dynamically bound objects.
  342.  
  343.     MyClass *obj1 = [MyClass new];
  344.  
  345.     // OK: obj1 conforms to the Archiving protocol.
  346.     id <Archiving> obj2 = obj1;
  347.  
  348.     // Error: obj1 does not conform to the TargetAction protocol.
  349.     id <TargetAction> obj3 = obj1;
  350.  
  351.     Another use of protocols is that you can declare an ID to conform to
  352.     some protocol in order to help the compiler to resolve method name
  353.     conflicts:
  354.  
  355.     @interface Foo: Object
  356.     -(int) type;
  357.     @end
  358.  
  359.     @protocol Bar
  360.     -(const char *) type;
  361.     @end
  362.  
  363.     -blah1: d
  364.     {
  365.       id t = [d someMethod];
  366.       do_something_with ([t type]);
  367.     }
  368.  
  369.     -blah2: d
  370.     {
  371.       id <Bar> t = [d someMethod];
  372.       do_something_with ([t type]);
  373.     }
  374.  
  375.     In this example, there are two kinds of the `-type' method.  In the
  376.     method `-blah1:', the compiler doesn't know what return type to expect
  377.     from `[t type]', since it has seen both declarations of `-type'.  In
  378.     method `-blah2:', it knows that `t' conforms to the `Bar' protocol and
  379.     thus that `t' implements the `-type' method returning a `const char *'.
  380.  
  381. 8   How can garbage collection be applied to Objective-C?
  382.  
  383.     Currently, there are two implementations of garbage collection which can
  384.     be used in Objective-C programs [that I'm aware of].  Both methods use a
  385.     radically different approach.
  386.  
  387.     Garbage Collection in an Uncooperative Environment
  388.  
  389.         This implements garbage collection of chunks of memory obtained
  390.         through (its replacement of) malloc(3).  It works for C, C++,
  391.         Objective-C, etc.
  392.  
  393.         @article{bw88,
  394.         title="Garbage Collection in an Uncooperative Environment",
  395.         author="Hans J\"urgen Boehm and Mark Weiser",
  396.         journal="Software Practice and Experience",
  397.         pages=807-820,volume=18,number=9,month=sep,year=1988}
  398.  
  399.         It is available as `ftp://parcftp.xerox.com/pub/gc/gc4.3.tar.gz'.
  400.  
  401.     Garbage Collection through Class Abstraction
  402.  
  403.         This implements garbage collection through class abstraction
  404.         (and hence is Objective-C specific).  Anything to be garbage
  405.         collectible must be an object (instance of a subclass of a
  406.         specific class) or have such an object for a wrapper.
  407.  
  408.         Available as `ftp://ftp.es.ele.tue.nl/pub/tiggr/tl.tar.gz'
  409.  
  410.     Apart from the obvious radical difference, another difference currently
  411.     is also noteworthy: The first method automatically protects objects
  412.     pointed to from the stack, bss or data segments; the second doesn't.
  413.  
  414. 9   What is the difference between the NeXTSTEP, Stepstone and GNU CC
  415.     versions of Objective-C?
  416.  
  417.     NeXT extended Stepstone's definition of the language to include new
  418.     constructs, such as protocols, which are touted to deal with some
  419.     aspects of multiple inheritance.
  420.  
  421.     Stepstone supports static _binding_, whereas NeXTSTEP and GNU CC don't.
  422.     All implementations do support static _typing_.
  423.  
  424.     Stepstone has a standard set of Foundation class libraries that work
  425.     across all supported machines, including NeXTSTEP.  NEXTSTEP comes with
  426.     its own set of libraries (called `kits').  GNU libobjc.a currently only
  427.     includes the `Object' class, though people are busy on a Real library
  428.     (see part two of this FAQ (The ClassWare Listing) for details).
  429.  
  430.     The `Object' class of all implementations differ.
  431.  
  432.     NeXTSTEP and GNU CC support Categories, Stepstone doesn't.
  433.  
  434.     NeXT has a native language debugger (which is a modified gdb);
  435.     Stepstone doesn't; for GNU, patches are available to turn gdb 4.16
  436.     into an Objective-C aware debugger.
  437.  
  438.     NeXTSTEP (from version 3.0) and GCC (from version 2.4) support protocols
  439.     and forward declarations of classes, Stepstone currently does not.
  440.  
  441. 10  How do I debug Objective-C using a non-NeXT gdb.
  442.  
  443.     On August 20 1996, Michael Snyder of NeXT posted patches to GDB 4.16
  444.     to make it Objective-C aware for GNU Objective-C code, at least tested
  445.     on HP-UX, Solaris and MS Windows.  As he did not supply a net.address
  446.     for these patches, I've made them available as
  447.     ftp://ftp.es.ele.tue.nl/pub/objc/gdb-gnu-objc.diff.gz.uue, accompanied
  448.     by ftp://ftp.es.ele.tue.nl/pub/objc/gdb-gnu-objc.README.
  449.  
  450.     Debugging Objective-C using a non-Objective-C aware gdb has been
  451.     documented by Martin Cracauer <cracauer@wavehh.hanse.de> on
  452.     http://www.cons.org/cracauer/objc-hint-gdb.html.  (It comes down to
  453.     understanding that you can very well look at Objective-C from the C
  454.     perspective, a language very well understood by gdb.)
  455.  
  456. 11  I get this `Floating exception'...
  457.  
  458.     Then you're running Linux and adding `-lieee' to the linker invocation
  459.     could help.  Thomas March <amadeus@bga.com> reported that on several
  460.     occasions, on systems running Linux ELF, with libc.so.5.0.9 and
  461.     libm.so.5.?.?, the problem was reproducable and adding `-lieee' did not
  462.     solve the problem.  However, switching to a newer libc (libc.so.5.2.18
  463.     and libm.so.5.0.5) both solved the problem and removed the need for
  464.     `-lieee' (i.e. a back to normal situation).
  465.  
  466.     If the problem you're having does not fit either description given, ask.
  467.  
  468. 12  Why am I lectured by gcc about `#import'?
  469.  
  470.     GNU CC issues the following multi-line warning about the how the use
  471.     of `#import' is discouraged (output from GNU CC 2.7.0):
  472.  
  473.     foo.m:1: warning: using `#import' is not recommended
  474.     The fact that a certain header file need not be processed more than once
  475.     should be indicated in the header file, not where it is used.
  476.     The best way to do this is with a conditional of this form:
  477.  
  478.       #ifndef _FOO_H_INCLUDED
  479.       #define _FOO_H_INCLUDED
  480.       ... <real contents of file> ...
  481.       #endif /* Not _FOO_H_INCLUDED */
  482.  
  483.     Then users can use `#include' any number of times.
  484.     GNU C automatically avoids processing the file more than once
  485.     when it is equipped with such a conditional.
  486.  
  487.     In short, use `-Wno-import' as an argument to gcc to stop it from
  488.     producing this.  Another possibility is to compile gcc after having
  489.     changed the line reading `static int warn_import = 1' into `static
  490.     int warn_import = 0' in `cccp.c' (line 467 in GNU CC 2.7.1); this way,
  491.     `-Wno-import' is the default setting.
  492.  
  493.     Whether or not using `#import' is desirable (obviously) has to do with
  494.     how to prevent multiple inclusions of the same file.  Most include
  495.     files, when included multiple times, either do nothing new (possibly
  496.     due to guards being used) or (without the guards) cause the emission
  497.     of C code on which the compiler will choke (due to, for instance,
  498.     repeated typedefs).  Thus, if everybody were to use `#import'
  499.     everybody would be happy, since it does not seem to matter.  However,
  500.     a notable exception to this rule is `assert.h', which changes the
  501.     definition of the `assert' macro depending on the setting of the
  502.     NDEBUG macro.
  503.  
  504.     There is one point to be made in favour of the warning: if the _user_
  505.     of an include file uses `#include' instead of `#import', the guards
  506.     will be necessary.  Thus, actually, the warning should be issued when
  507.     a file is imported that appears not to be guarded.
  508.  
  509.     Apart from the more-or-less religious (and thus useless) debate
  510.     whether `#import' or `#include'-with-guards is better, it has been
  511.     observed that `#import' does not catch re-reading a linked and/or
  512.     duplicated file, whereas the guards do.  However, this is, of course,
  513.     a highly unlikely and probably undesirable situation for which neither
  514.     was designed to catch.
  515.  
  516.     The reason for the existence of `#import' probably is historical: the
  517.     first implementation of Objective-C (by Stepstone) was as a preprocessor
  518.     to C, run after a modified cpp.  `#import' was the include-once
  519.     directive to that cpp.  Since it is part of the Objective-C language, it
  520.     has made it into GNU CC's cpp.
  521.  
  522. 13  Did NeXT buy Stepstone?
  523.  
  524.     No they didn't!
  525.  
  526.     NeXT did acquire all rights previously owned by Stepstone to the
  527.     Objective-C trademark and Objective-C language.  More information on
  528.     `http://www.next.com/AboutNeXT/PressKit/PressReleases/1995/stepstone.040495.html'.
  529.  
  530. 14  What written information concerning Objective-C is available?
  531.  
  532.     Books on Objective-C, or object oriented programming in general:
  533.  
  534.     Brad J. Cox, Andrew J. Novobilski: Object Oriented Programming: An
  535.     Evolutionary Approach.  Addison-Wesley Publishing Company, Reading,
  536.     Massachusetts, 1991.  ISBN: 0-201-54834-8 (Japanese: 4-8101-8046-8).
  537.  
  538.     abstract:    The first book on Objective-C, which actually is a
  539.                     book on object oriented system development using
  540.                     Objective-C.
  541.  
  542.     Lewis J. Pinson, Richard S. Wiener: Objective-C: Object Oriented
  543.     Programming Techniques.  Addison-Wesley Publishing Company, Reading,
  544.     Massachusetts, 1991. ISBN 0-201-50828-1 (Japanese: 4-8101-8054-9).
  545.  
  546.     abstract:       Includes many examples, discusses both Stepstone's
  547.                     and NeXT's versions of Objective-C, and the
  548.                     differences between the two.
  549.  
  550.     Timothy Budd: An Introduction to Object-Oriented Programming.
  551.     Addison-Wesley Publishing Company, Reading, Massachusetts.
  552.     ISBN 0-201-54709-0 (Japanese: 4-8101-8048-4).
  553.  
  554.     abstract:       An intro to the topic of OOP, as well as a comparison
  555.                     of C++, Objective-C, Smalltalk, and Object Pascal
  556.  
  557.     Simson L. Garfinkel, Michael K. Mahoney: NeXTSTEP Programming Step
  558.     ONE: Object-Oriented Applications.  TELOS/Springer-Verlag, 1993
  559.     (tel: (800)SPR-INGE).
  560.  
  561.     abstract:       It's updated to discuss NeXTSTEP 3.0 features
  562.                     (Project Builder, new development environment)
  563.                     but doesn't discuss 3DKit or DBKit.
  564.  
  565.     NeXTSTEP Object Oriented Programming and the Objective C Language.
  566.     Addison-Wesley Publishing Company, Reading, Massachusetts, 1993.
  567.     ISBN 0-201-63251-9 (Japanese: 4-7952-9636-7).  This is also
  568.     available on the World Wide Web at
  569.     http://www.next.com/Pubs/Documents/OPENSTEP/ObjectiveC/objctoc.htm.
  570.  
  571.     abstract:     This book describes the Objective-C language as it
  572.             is implemented for NeXTSTEP.  While clearly targeted
  573.             at NeXTSTEP, it is a good first-read to get to learn
  574.             Objective-C.
  575.  
  576.     Articles
  577.  
  578.     `Why I need Objective-C', by Christopher Lozinski.
  579.     Journal of Object-Oriented Programming (JOOP) September 1991.
  580.     Contact info@bpg.com for a copy and subscription to the BPG
  581.     newsletter.
  582.  
  583.     Abstract:    This article discusses the differences between C++
  584.             and Objective-C in great detail and explains why
  585.             Objective-C is a better object oriented language.
  586.  
  587.     `Concurrent Object-Oriented C (cooC)', by Rajiv Trehan et. al.
  588.     ACM SIGPLAN Notices, Vol. 28, No 2, February 1993.
  589.  
  590.     Abstract:    This article discusses cooC, a language based on the
  591.             premise that an object not only provides an
  592.             encapsulation boundary but should also form a
  593.             process boundary.  cooC is a superset of
  594.             Objective-C.
  595.  
  596.     `Porting NEXTSTEP Applications to Microsoft Windows',
  597.     by Christopher Lozinski.  NEXTWORLD EXPO Conference Proceedings,
  598.     San Francisco, CA, May 25-27, 1993.  Updated version of the article
  599.     available from the author.  Contact info@bpg.com.
  600.  
  601.     Abstract:    This article describes how to develop Objective-C
  602.             applications for both Microsoft Windows and
  603.             NEXTSTEP.
  604.  
  605.     GNU Documentation
  606.  
  607.     The GNU project needs a free manual describing the Objective-C
  608.     language features.  Because of its cause, GNU cannot include the
  609.     non-free books in the GNU system, but the system needs to come with
  610.     documentation.
  611.  
  612.     Anyone who can write good documentation, please think about giving
  613.     it to the GNU project.  Contact rms@gnu.ai.mit.edu.
  614.  
  615. 15  What kind of Objective-C support is provided by Stepstone?
  616.  
  617.     Compilers and runtime for: Apple Macintosh (running Mac Programmers
  618.     Workshop), DEC Stations (ULTRIX), Data General AViiON (DG/UX),
  619.     HP9000/300,400,700,800 (HP-UX), IBM RISC System/6000 (AIX), MIPS,
  620.     NeXT, PC-AT (MS-DOS, OS/2), PS/2 (AIX), SCO/NCR UNIX SYS V, Sun 3, 4,
  621.     SPARCstations (SunOS or Solaris), Silicon Graphics INDIGO and VAX(VMS).
  622.     Other ports available by market demands or consulting services.
  623.  
  624.     ICpak101 Foundation Class Library is available on all the above.
  625.     ICpak201 GUI Class Library is available on platforms that support
  626.     XWindows, Motif, OpenWindows and SunView.
  627.  
  628.        The Stepstone Corporation
  629.     (203) 426-1875 - (800) BUY-OBJEct voice / (203) 270-0106 fax
  630.     75 Glen Road
  631.     Sandy Hook, CT 06482
  632.  
  633. 16  What kind of Objective-C support is provided by NeXT?
  634.  
  635.     The Objective-C compiler and libraries come bundled with the
  636.     NEXTSTEP Developer CD.  The compiler essentially is GNU CC.  For
  637.     information on the Kits which are part of NEXTSTEP, see the
  638.     ClassWare Listing (part 2 of this FAQ).
  639.  
  640.     The sources to the NeXT-modified GNU products are available on the
  641.     developer CD, and from
  642.     ftp://ftp.next.com/pub/SoftwareDownloads/GNUSource/.
  643.  
  644.     Products are:
  645.  
  646.         NEXTSTEP 3.3, Mach/OpenStep 4.x, OpenStep/NT, Enterprise
  647.         Objects Framework (EOF), Portable Distributed Objects (PDO),
  648.         and WebObjects.
  649.  
  650.     NeXT Computer, Inc.
  651.     900 Chesapeake Drive
  652.     Redwood City, CA 94063
  653.     tel: 800 848 NEXT
  654.     fax: 415 780 2801
  655.     email: NeXTanswers@NeXT.COM
  656.     www: http://www.next.com/
  657.  
  658. 17  What kind of Objective-C support is provided by GNU?
  659.  
  660.     GNU CC, since version 2, comes with an Objective-C compiler.  The
  661.     current distribution of GNU CC (version 2.7.2.1) includes an
  662.     Objective-C compiler and runtime library.  The latter includes the
  663.     `Object' and `NXConstantString' classes.  In future distributions the
  664.     runtime library will be thread-safe.  Some people are working on GNU
  665.     libraries, see part 2 of this FAQ (The ClassWare Listing) for details
  666.     or visit http://www.gnustep.org/.
  667.  
  668.     If you haven't switched to a GNU CC as recent as 2.4 yet, here's one
  669.     reason to do so: The new runtime (as of 2.4) is more than 3 times as
  670.     fast as the old runtime (pre 2.4) w.r.t. method invocation.
  671.  
  672.     Free Software Foundation
  673.     59 Temple Place -- Suite 330
  674.     Boston, MA   02111
  675.     +1-617-542-5942
  676.  
  677.     General questions about the GNU Project can be asked to
  678.     gnu@prep.ai.mit.edu.
  679.  
  680.     For information on how to order GNU software on tape or cd-rom, and
  681.     printed GNU manuals, check the file etc/ORDERS in the GNU Emacs
  682.     distribution, ftp the file /pub/gnu/GNUinfo/ORDERS on prep, or e-mail
  683.     a request to: gnu@prep.ai.mit.edu
  684.  
  685.     By ordering your GNU software from the FSF, you help us continue to
  686.     develop more free software.  Media revenues are our primary source of
  687.     support.  Donations to FSF are deductible on US tax returns.
  688.  
  689.     The above software will soon be at these ftp sites as well.  Please
  690.     try them before prep.ai.mit.edu as prep is very busy!
  691.  
  692.       thanx -gnu@prep.ai.mit.edu
  693.  
  694.         ASIA: ftp.cs.titech.ac.jp, tron.um.u-tokyo.ac.jp/pub/GNU/prep
  695.      cair-archive.kaist.ac.kr/pub/gnu, ftp.nectec.or.th/pub/mirrors/gnu
  696.         AUSTRALIA: archie.au/gnu (archie.oz or archie.oz.au for ACSnet)
  697.         AFRICA: ftp.sun.ac.za/pub/gnu
  698.         MIDDLE-EAST: ftp.technion.ac.il/pub/unsupported/gnu
  699.         EUROPE: irisa.irisa.fr/pub/gnu, ftp.univ-lyon1.fr:pub/gnu,
  700.      ftp.mcc.ac.uk, unix.hensa.ac.uk/mirrors/uunet/systems/gnu,
  701.      src.doc.ic.ac.uk/gnu, ftp.ieunet.ie:pub/gnu, ftp.eunet.ch,
  702.      nic.sunsite.cnlab-switch.ch/mirror/gnu, ftp.win.tue.nl/pub/gnu,
  703.      ftp.nl.net, ftp.informatik.rwth-aachen.de/pub/gnu,
  704.      ftp.informatik.tu-muenchen.de, ftp.etsimo.uniovi.es/pub/gnu,
  705.      ftp.funet.fi/pub/gnu, ftp.denet.dk, ftp.stacken.kth.se,
  706.      isy.liu.se, ftp.luth.se/pub/unix/gnu,
  707.      ftp.sunet.se/pub/gnu, archive.eu.net
  708.         SOUTH AMERICA: ftp.inf.utfsm.cl/pub/gnu, ftp.unicamp.br/pub/gnu
  709.         WESTERN CANADA: ftp.cs.ubc.ca/mirror2/gnu
  710.         USA: wuarchive.wustl.edu/systems/gnu, labrea.stanford.edu,
  711.      ftp.digex.net/pub/gnu, ftp.kpc.com/pub/mirror/gnu,
  712.      f.ms.uky.edu/pub3/gnu, jaguar.utah.edu/gnustuff,
  713.      ftp.hawaii.edu/mirrors/gnu, uiarchive.cso.uiuc.edu/pub/gnu,
  714.      ftp.cs.columbia.edu/archives/gnu/prep,
  715.      archive.cis.ohio-state.edu/pub/gnu, gatekeeper.dec.com/pub/GNU,
  716.      ftp.uu.net/systems/gnu
  717.  
  718.     [GNU FTP mirror site list dd Tue Jan 13 1997.]
  719.  
  720. 18  Is Objective-C supported on <my favourite platform>?
  721.  
  722.     Below is a list of compilers supporting Objective-C, and which are not
  723.     NeXT's, Stepstone's or plain GCC.  [This section is being edited.]
  724.  
  725.     Various platforms
  726.  
  727.         Portable Object Compiler
  728.  
  729.         The Portable Object Compiler runs on various UNIX platforms,
  730.         including AIX, OSF/1, Linux, NextStep, IRIX, HP-UX, SunOS and
  731.         Solaris.  It is currently being ported to BeOS and WindowsNT.
  732.  
  733.         The Portable Object Compiler is freely obtainable (comes with
  734.         source) from the Computer Algebra Objects website, currently
  735.         at, http://www.can.nl/~stes.
  736.  
  737.         Included is a collection library, ObjectPak which compiles on,
  738.         and works with, Stepstone Objective C, GNU Objective C and
  739.         NeXT Objective C.  This library also comes with source code.
  740.  
  741.         [The Portable Object Compiler does not provide protocols.]
  742.  
  743.     DOS, Windows, OS/2
  744.  
  745.     BPG
  746.  
  747.         BPG provides the Borland Extensions to Objective-C which
  748.         allows the Objective-C translator to be used with the Borland
  749.         Compiler, and makes it easy to develop Objective-C application
  750.         for Microsoft Windows.
  751.  
  752.         BPG provides the Smalltalk Interface to Objective-C which
  753.         makes Objective-C objects look like Smalltalk Objects.  It can
  754.         be used to build Graphical User Interface on portable
  755.         Objective-C objects, or to sell Objective-C libraries to
  756.         Smalltalk developers.
  757.  
  758.         BPG provides the Objective-C Message Bus which sends
  759.         Objective-C messages across heterogeneous computer platforms.
  760.  
  761.         BPG has a library of objects for modelling Objective-C
  762.         programs.  A browser application has been built on this
  763.         library.  Other potential applications include adding class
  764.         variables to Objective-C, adding runtime information about
  765.         instance variables, and method argument types, generating
  766.         object versions, and eventually building a browser/translator.
  767.  
  768.         Christopher Lozinski
  769.         BPG
  770.         35032 Maidstone Court
  771.         Newark, CA 94560
  772.         Tel: (510) 795-6086
  773.         fax: (510) 795-8077
  774.         email: info@bpg.com
  775.  
  776.     DJGPP
  777.  
  778.         DJGPP includes Objective-C support [though I do not know to
  779.         which extent].
  780.  
  781.         From the DJGGP homepage at http://www.delorie.com:
  782.  
  783.         DJGPP is a complete 32-bit C/C++ development system for
  784.         Intel 80386 (and higher) PCs running DOS. It includes
  785.         ports of many GNU development utilities. The development
  786.         tools require a 80386 or newer computer to run, as do the
  787.         programs they produce. In most cases, the programs it
  788.         produces can be sold commercially without license or
  789.         royalties.
  790.  
  791.     GCC/EMX
  792.  
  793.         The EMX port of GCC implements Objective-C, and with RSX (or
  794.         RSXNT) it runs on DOS/DPMI boxes (or NT) too.
  795.  
  796.         EMX is available for anonymous ftp on at following locations:
  797.  
  798.         ftp://ftp.uni-stuttgart.de/pub/systems/os2/emx-0.9c
  799.         ftp://ftp-os2.cdrom.com/pub/os2/lang/emx09c
  800.         ftp://ftp-os2.nmsu.edu/os2/unix/emx09c
  801.         ftp://ftp.leo.org/pub/comp/os/os2/devtools/emx+gcc
  802.         ftp://src.doc.ic.ac.uk/packages/os2/unix/emx09c
  803.  
  804.         RSX is available from
  805.         ftp://ftp.uni-bielefeld.de/pub/systems/msdos/misc/
  806.         Without RSX EMX is limited to DOS/VCPI and OS/2 >=2.0)
  807.  
  808.         [Thanks to <huug@poboxes.com> for this information.]
  809.  
  810.     GCC for Win32
  811.  
  812.         Hyungjip Kim <hjkim@namo.co.kr> provides GCC 2.7.2 binaries
  813.         for Win32.  This GCC is modified to generate CodeView
  814.         compatible debug information, to enable the use of existing
  815.         Windows debuggers.  Visit http://www.namo.co.kr/~hjkim/objc/
  816.         for more information, and the binaries.
  817.  
  818.     GNU-Win32
  819.  
  820.         The GNU-Win32 project aims at providing the GNU tools
  821.         (including GCC) for Windows NT/95.  [I do not know to which
  822.         extent Objective-C is supported.]  Below is a description of
  823.         the project, taken from http://www.cygnus.com/misc/gnu-win32:
  824.  
  825.         The GNU-Win32 tools are ports of the popular GNU
  826.         development tools to Windows NT/95 for the x86 and powerpc
  827.         processors. Applications built with these tools have
  828.         access to the Microsoft Win32 API as well as the Cygwin32
  829.         API which provides additional UNIX-like functionality
  830.         including UNIX sockets, process control with a working
  831.         fork and select, etc...
  832.  
  833.         With these tools installed, it is now possible to: 
  834.  
  835.         write Win32 console or GUI applications that make use of
  836.         the standard Microsoft Win32 API and/or the Cygwin32 API.
  837.         
  838.         easily configure and build many GNU tools from source
  839.         (including rebuilding the gnu-win32 development tools
  840.         themselves under x86 NT).
  841.         
  842.         port many other significant UNIX programs to Windows NT/95
  843.         without making significant changes to the source code.
  844.         
  845.         have a fairly full UNIX-like environment to work in, with
  846.         access to many of the common Unix utilities (from both the
  847.         bash shell and command.com).
  848.  
  849.         The GNU-Win32 project is run by Cygnus; for more information
  850.         see http://www.cygnus.com.
  851.  
  852.     Macintosh
  853.  
  854.     With the recent acquirement of NeXT by Apple, support of
  855.     Objective-C on the Macintosh will boom.  Undoubtebly Apple will
  856.     provide Objective-C support, and Metrowerks have announced support
  857.     for Objective-C in their CodeWarrior.
  858.  
  859. 19  What are the newsgroups to read or mailing lists to subscribe to in order
  860.     to stay up-to-date on developments for GNU Objective-C?
  861.  
  862.     Read comp.lang.objective-c, which is bound to discuss current events.
  863.     There is also a mailing list, gnu-objc@gnu.ai.mit.edu, discussing this
  864.     very topic.  To subscribe to this list, send a mail with your request to
  865.     `gnu-objc-request@gnu.ai.mit.edu.'
  866.  
  867.     Furthermore, the various kits that are being developed each come with
  868.     their own mailing list.  See part 2 of this FAQ for more information.
  869.  
  870. 20  Are there any FTP sites with Objective C code?  Where?
  871.  
  872.     ftp://next-ftp.peak.org/pub/next/    (NEXTSTEP)
  873.     ftp://ftp.informatik.uni-muenchen.de
  874.     ftp://ftp.gnustep.org/pub/        (GNUStep)
  875.     ftp://ftp.stack.urc.tue.nl/pub/next/    (NEXTSTEP)
  876.     ftp://ccrma-ftp.stanford.edu/pub/NeXT/    (MusicKit a.o.)
  877.     ftp://ftp.informatik.uni-freiburg.de
  878.     ftp://ftp.cs.unl.edu/pub/ObjC        (some sw and docs)
  879.  
  880.     See also part 2 of this FAQ.
  881.  
  882. 21  If there any information on the Net concerning Objective-C?
  883.  
  884.     Basic and related Objective-C (and/or NeXTSTEP) information is available
  885.     at the following places:
  886.  
  887.     NeXT at http://www.next.com/ with the NeXT Objective-C book at
  888.     http://www.next.com/Pubs/Documents/OPENSTEP/ObjectiveC/objctoc.htm,
  889.  
  890.     Steve deKorte's Objective-C page at
  891.     http://www.batech.com/~dekorte/Objective-C/objc.html,
  892.  
  893.     Brad Cox's Objective-C page at
  894.     http://www.virtualschool.edu/mon/Cox/ObjectiveC.html,
  895.  
  896.     the GNUStep project at http://www.gnustep.org/, with a mirror at
  897.     http://www.nmr.embl-heidelberg.de/GNUstep
  898.  
  899.     the libobjects FAQ at
  900.     ftp://ftp.cs.rochester.edu/pub/u/mccallum/libobjects/Gnustep-FAQ.html,
  901.  
  902.     the NEXTSTEP/OpenStep Information Service at http://www.stepwise.com/,
  903.  
  904.     the eduStep initiative at http://www.nmr.embl-heidelberg.de/eduStep/,
  905.  
  906.     Nelson Minar's Objective-C page at
  907.     http://www.santafe.edu/~nelson/objective-c.html,
  908.  
  909.     Tiggr's Objective-C page at http://www.es.ele.tue.nl/tiggr/objc/,
  910.  
  911.     Kennet Lerman's page at http://w3.nai.net/~lerman/,
  912.  
  913.     Norihiro Itoh's page at http://www.etl.go.jp/etl/bunsan/~nito/,
  914.  
  915.     and of course the HTML versions of this FAQ and associated information
  916.     at the addresses listed below.
  917.  
  918. 22 For more information...
  919.  
  920.     Visit one of the places mentioned in #21, or see part 2 of this FAQ,
  921.     Objective-C/classes a.k.a. the ClassWare Listing, for an [incomplete!]
  922.     overview of available Objective-C classes and libraries.  See part 3 of
  923.     this FAQ, Objective-C/sample a.k.a. the Simple Sample Program, for an
  924.     example Objective-C program.
  925.  
  926. A Japanese language version of this FAQ is maintained by Norihiro Itoh
  927. <nito@argotechnos.co.jp>.  It is posted to fj.archives.answers regularly.  A
  928. hypertext version is maintained by Toru Sato <www-admin@cnds.canon.co.jp>
  929. and is available at
  930. http://www.cnds.canon.co.jp/Japanese_EUC/Contribution/FAQ_Objective-C/objc_faq_J.html.
  931.  
  932. A World Wide Web hypertext version of this FAQ is maintained by Brian Harvey
  933. <theharv@csld.ucr.edu>.  It is http://csld.ucr.edu/NeXTSTEP/objc_faq.html.
  934. Another WWW version of this FAQ is maintained by Steve Dekorte
  935. <dekorte@suite.com> at http://www.batech.com/~dekorte/Objective-C/objc.html.
  936.  
  937. The early version of this FAQ was compiled by Bill Shirley, with the aid of
  938. many people.  The current version is being maintained by Tiggr, aided by input
  939. from a lot of people, including: Per Abrahamsen, Paul Burchard, Brad Cox,
  940. Christopher Lozinski, Mike Mahoney, Jon F. Rosen, Paul Sanchez, Lee Sailer,
  941. Paul Sanchez, Bill Shirley, Subrata Sircar, Ted Slupesky, Richard Stallman,
  942. and Kersten Krab Thorup,
  943.  
  944. Any text in between `[' and `]' is a comment.  Comments indicate `problems'
  945. with this FAQ, which should be solved.  Send your suggestions, additions,
  946. bug reports, comments and fixes to `tiggr@es.ele.tue.nl'.
  947.  
  948.     The information in this file comes AS IS, WITHOUT ANY WARRANTY.  You may
  949.     use the information contained in this file or distribute this file, as
  950.     long as you do not modify it, make money out of it or take the credits.
  951.